import { request } from "@/utils/service"
import type {
  CommentData,
  addCommentResponseData,
  getCommentListRequestData,
  getCommentListResponseData,
  getCommentDetailResponseData
} from "./types/comment"

/**提交沟通记录 */
export function addComment(data: CommentData) {
  return request<addCommentResponseData>({
    url: "crm/comment",
    method: "post",
    data
  })
}
/**获取沟通记录列表（给参数可以分页） */
export function getCommentList(data: getCommentListRequestData) {
  return request<getCommentListResponseData>({
    url: "crm/comment/list",
    method: "post",
    data
  })
}

/**获取沟通记录详情 */
export function getCommentDetail(params: { id: string }) {
  console.log(params)
  return request<getCommentDetailResponseData>({
    url: "crm/comment",
    method: "get",
    params
  })
}
